import { Commit } from "vuex";

interface IGoodLists {
  beforePriceLabelType: number;
  dtitle: string;
  goodsid: string;
  huodongType: number;
  id: number;
  isShow: number;
  istmall: number;
  jiage: number;
  pic: string;
  quanJine: number;
  sellNum: number;
  shortTag: string;
  special: string;
  title: string;
  tmall: number;
  xiaoliang: number;
  yuanjia: number;
}
interface INiceList {
  beforePriceLabelType: number;
  dtitle: string;
  goodsid: string;
  huodongType: number;
  id: number;
  isShow: number;
  istmall: number;
  jiage: number;
  pic: string;
  quanJine: number;
  sellNum: number;
  shortTag: string;
  special: string;
  title: string;
  tmall: number;
  xiaoliang: number;
  yuanjia: number;
}
interface INavs {
  id: number;
  navList: [];
  originId: number;
  title: string;
  type: number;
}
interface IState {
  goodLists: Partial<IGoodLists>[];
  niceLists: Partial<INiceList>[];
  navs: Partial<INavs>[];
}

interface IPostAge {
  namespaced: boolean;
  state: IState;
  actions: {
    getGoodLists: (
      { commit }: { commit: Commit },
      {
        params,
      }: {
        params: {
          cid: number;
          pageNo: number;
          pageSize: number;
        };
      }
    ) => void;
    getNiceLists: ({ commit }: { commit: Commit }) => void;
    getPostAgeNav: ({ commit }: { commit: Commit }) => void;
    getMoreLists: (
      { commit }: { commit: Commit },
      {
        params,
      }: {
        params: {
          cid: number;
          pageNo: number;
          pageSize: number;
        };
      }
    ) => void;
  };
  mutations: {
    GET_GOODLISTS: (
      state: IState,
      action: { type: string; payload: IGoodLists[] }
    ) => void;
    GET_NICELISTS: (
      state: IState,
      action: { type: string; payload: INiceList[] }
    ) => void;
    GET_POSTAGE_NAV: (
      state: IState,
      action: { type: string; payload: INavs[] }
    ) => void;
    GET_MORELISTS: (
      state: IState,
      action: { type: string; payload: IGoodLists[] }
    ) => void;
  };
}

export { IPostAge, IGoodLists, IState };
